package cn.gailvlun.gll.net.apartment.member;

import android.support.annotation.Nullable;

import cn.gailvlun.gll.bean.PlaceHolder;
import cn.gailvlun.gll.net.ListRes;
import cn.gailvlun.gll.net.Member;
import cn.gailvlun.gll.net.Optional;

import cn.gailvlun.gll.net.token.Authorization;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;



public interface MemberService {

    
    @Authorization
    @GET("/member/")
    Observable<Member> getMember(@Optional @Query("room_id") Integer roomId,
                               @Optional @Query("member_id") Integer memberId,
                               @Optional @Query("is_promise") Boolean isPromise);

    @Authorization
    @GET("/member/list/")
    Observable<ListRes<Member>> getMemberList(@Query("room_id") int roomId,
                                              @Query("is_promise") @Nullable Boolean isPromise,
                                              @Query("id") @Nullable Integer id,
                                              @Query("direction") @Nullable String direction,
                                              @Query("limit") @Nullable Integer limit);

    
    @Authorization
    @DELETE("member/")
    Observable<PlaceHolder> deleteMember(@Query("member_id") int memberId);

    
    @Authorization
    @PUT("member/")
    Observable<Member> modifyMember(@Body ModifyMemberReq modifyMemberReq);

    
    @Authorization
    @POST("member/")
    Observable<Member> addMember(@Body AddMemberReq addMemberReq);

    @Authorization
    @POST("owcp/blockmember/")
    Observable<Member> blockMember(@Body BlockMemberReq blockMemberReq);
}
